﻿namespace GoodAdmin.System;

public class RoleExtraService : IRoleExtraService, ITransient
{
    private readonly ISysRoleService _sysRoleService;
    private readonly ISysUserService _sysUserService;

    public RoleExtraService(ISysRoleService sysRoleService,ISysUserService sysUserService)
    {
        _sysRoleService = sysRoleService;
        _sysUserService = sysUserService;
    }

    /// <inheritdoc/>
    public async Task<List<UserSimpleInfo>> GetRoleOwnUser(long roleId)
    {
        var userIdList= await _sysRoleService.GetRoleOwnUser(roleId);
        var user= await _sysUserService.GetUsersByField(userIdList,u=>u.Id);
        return user;
    }
}